package com.general.api.resource;

import com.general.api.interfaces.TestApiHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * @author SongJiuHua.
 * @date Created on 2018/1/31.
 * @description
 */
@Path("")
@Component
public class TestApiHelloResource {

    @Autowired
    private TestApiHelloService testApiHelloService;

    @GET
    @Path("/api/hello")
    @Produces(MediaType.APPLICATION_JSON)
    public Response testSayHello(@QueryParam("name") String name){
        String result = testApiHelloService.sayHelloToAdminServer(name);
        return Response.ok(result).build();
    }

}
